const http = require('http');
const fs = require('fs');
const url = require('url');
http.createServer((req, res)=>{
  const {pathname} = url.parse(req.url);
  if(pathname === './') {
    const data = fs.readFileSync('./index.html');
    res.end(data);
  } else {
    res.end();
  }
  console.log(req, res);
}).listen(3000,()=>{
  console.log("http://localhost:3000");
})